﻿<?php
class ValidController extends Zend_Controller_Action {	
    public function isvalidcaptchaAction()
    {
		$objRequest 	 = $this->_request;
		$strCaptchaInput = $objRequest->getParam('input');		
		$strSessionName  = $objRequest->getParam('SS','');
		echo Vfriend_Captcha_Image::validate($strCaptchaInput,$strSessionName);
		exit;
	}
	public function isvalidusernameAction() {
		$objRequest		= $this->_request;
		$AppUI			= Zend_Registry::get('AppUI');
		$strUsername	= $objRequest->getParam('username', '');
		if($AppUI->id > 0) {
			$objVfriendUser = new Vfriend_User();
			$objUser		= $objVfriendUser->getInfoByUsername($strUsername);
			if(!$objUser || ($objUser && $objUser->id == $AppUI->id)) {
				echo 1;
				exit();
			}
		}
		echo 0;
		exit();
	}
	public function isvalidpasswordAction() {
		include_once('valid/password.php');
	}
	public function isexistemailAction() {
		include_once('valid/email.php');
	}
}
?>